Filenames

A filename is an object which names a file. Filenames are immutable record structures with the following components:

 File system: the file system object via which the named file is accessible.

 Directory: a collection of files within the file system to which the named file belongs.

 Name: the name of the file within the directory, or of a family of files, as further specified by the file type and generation components of the filename.

 Type: the type of the file (also known as ``extension'').

 Generation: a positive integer specifying a particular version or incarnation of the file. Larger generation numbers indicate newer versions.

In general, the directory, name, and type components of a file are usually symbols, the file system component is a file system object, and the generation component is an integer. The file system component may be a symbol which names a file system in an implementation-dependent manner.

Filenames may be incompletely specified; missing components are represented by having null (false) as their value. An omitted file system is usually interpreted to be the same as the local file system, an omitted directory component means the current working directory. The name component may not be omitted.

The external representation of a filename has the form
\begin{codexenv}
\char93 [Filename {\it file-system dir name type gen\/}]
\end{codexenv}
where gen and type may be omitted, if null.



\begin{inset}{}
\par
Returns a filename. The arguments become the components of...
... gen\/} may be omitted, in which case they default to
null (absent).
\end{inset}


\begin{inset}{}
Coerces \iix{filespec} to a filename.
\begin{itemize}
\item[{}]I...
...ns, since the coercion of strings to filenames
is not defined here.
\end{inset}

Type predicate


\begin{inset}{}
Returns true if {\it object\/} is a filename.
\end{inset}


\begin{inset}{}
Returns the file system component of {\it filename\/}, or false (null)
if it has none.
\end{inset}


\begin{inset}{}
Returns the directory component of {\it filename\/}.
\end{inset}


\begin{inset}{}
Returns the name component of {\it filename\/}.
\begin{codexenv}...
...r93 [Filename () MATH FACT T]) $\Longrightarrow$\ FACT
\end{codexenv}\end{inset}


\begin{inset}{}
Returns the type component of {\it filename\/}.
\end{inset}


\begin{inset}{}
Returns the generation component of {\it filename\/}.
\end{inset}


\begin{inset}{}
Returns a string representing {\it filename\/} in the native syn...
...usr/math}, e.g. by a \lq\lq {\tt setenv MATH /usr/math}''
shell command.)
\end{inset}